﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using database.DAOImpl;
using database.Entities;

namespace database
{
    public partial class Control_Shop_search : UserControl
    {
        Control_Shop father = null;
        public Control_Shop_search()
        {
            InitializeComponent();
        }

        public Control_Shop_search(Control_Shop father)
        {
            this.father = father;
            InitializeComponent();
        }

        private void shopInfo1_Load(object sender, EventArgs e)
        {

        }

        private void shopSearch1_Load(object sender, EventArgs e)
        {

        }

        private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0) return;
            int id = int.Parse(this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
            if (this.father != null)
            {
                this.father.modify(id);
            }
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void Control_Shop_search_Load(object sender, EventArgs e)
        {

        }

        private void ShopSearch_Load(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

            for (int i = 0; i < 4; i++)
            {
                int index = this.dataGridView1.Rows.Add();
                this.dataGridView1.Rows[index].Cells[0].Value = 4-i;
            }
        }
    }
}
